/* GSTC Contact-Us branch & port locator (interactive Google Map).
   Embedded inside the portal Contact-Us page. Brand tokens are scoped to
   .locator so this file never overrides the rest of the portal. RTL-first
   (ar-SA primary); logical properties keep en-US (LTR) usable too. */
#map button {
  min-width: initial;
}
.locator {


  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-background-light);
}

.locator-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* padding-inline: 24px; */
}

.locator-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.locator .nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  border: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.locator .nav-tabs li {
  list-style: none;
}

.locator .nav-tabs::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  width: 100%;
  height: 3px;
  border-radius: 16px;
  background-color: var(--color-border);
}

.nav-tab {
  position: relative;
  height: 3rem;
  align-items: center;
  padding: 0 1rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
  white-space: nowrap;
}

.nav-tab::after {
  content: "";
  position: absolute;
  bottom: 1px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: calc(100% - 2rem);
  height: 3px;
  border-radius: 16px;
  background-color: var(--color-text-dark);
  opacity: 0;
  transition: 0.2s;
  z-index: 2;
}

.nav-tab:not(.active):hover {
  background-color: var(--color-background-dark);
}

.nav-tab:not(.active):hover::after {
  opacity: 1;
}

.nav-tab.active {
  color: var(--color-text-dark);
  font-weight: 600;
  cursor: default;
}

.nav-tab.active::after {
  background-color: var(--color-primary);
  opacity: 1;
}

.locator-controls {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 16px;
  padding: 18px 24px;
}

/* Branch select dropdown (sits in row 1 next to the tabs) */
.branch-select-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 320px;
  max-width: 100%;
}

.controls-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
}



.branch-select-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background-light);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  appearance: none;
  cursor: pointer;
}

.branch-select-wrap select:focus {
  border-color: var(--color-primary);
}

/* chevron sits at the inline-start edge */
/* .branch-select-wrap::after {
  content: "";
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-text-light);
  border-bottom: 2px solid var(--color-text-light);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
} */

/* Geospatial toggle */
.geo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-dark);
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch:hover {
  box-shadow: 0 0 0 6px #f3f4f6;
  border-radius: 999px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  /* background: var(--color-border); */
  background: #fff;
  border: 1px solid #000;
  box-sizing: border-box;
  border-radius: 999px;
  transition: 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  transform: translateX(18px);
  height: 18px;
  width: 18px;
  top: 2px;
  inset-inline-end: 2px;
  background: #000;
  border-radius: 50%;
  transition: all .25s ease-in-out;
  /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); */
}

.switch input:checked + .slider {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.switch input:checked + .slider:hover {
  background: var(--color-primary-dark);
}
.switch input:checked + .slider::before {
  background: #fff;
  
}
[dir="rtl"] .switch input:checked + .slider::before {
  transform: translateX(0px);
}

/* en-US (LTR): slider thumb travels the other way */
[dir="ltr"] .switch input:checked + .slider::before {
  transform: translateX(0px);
}
[dir="ltr"] .switch .slider::before {
  transform: translateX(-18px);
}

/* Region filter buttons */
.region-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.region-btn {
  min-width: 60px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background-light);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: 0.18s;
}

.region-btn:hover:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.region-btn.active {
  background: var(--color-text-dark);
  border-color: var(--color-text-dark);
  color: #fff;
}

/* ── Map ───────────────────────────────────────────────────────── */
#map-wrap {
  position: relative;
  height: 560px;
  min-width: 0;
  overflow: hidden;
}

#map,
#geoMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Two engines share the wrap; the geospatial switch shows one at a time.
   Google (#map) is the default; #geoMap (GEOSA/Leaflet) is revealed via the
   .show-geo class the locator JS sets on #map-wrap. */
#geoMap {
  display: none;
}

#map-wrap.show-geo #map {
  display: none;
}

#map-wrap.show-geo #geoMap {
  display: block;
}

/* Cluster blob marker (geospatial view) */
.cluster-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-family, sans-serif);
  font-weight: 600;
  font-size: 13px;
  border: 6px solid rgba(5, 100, 99, 0.35);
  box-shadow: 0 0 0 10px rgba(5, 100, 99, 0.18);
  transform: translateZ(0);
}

/* ── GEOSA (Leaflet) map ───────────────────────────────────────── */
/* Teal-themed zoom + home controls (ported from the GEOSA file's green
   styling, mapped onto the portal teal tokens). Scoped to #geoMap so the
   global Leaflet control classes don't affect anything else. */
#geoMap .leaflet-control-zoom a,
#geoMap .leaflet-control-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.6rem;
  color: var(--color-primary);
  background-color: #fff;
  font-weight: bold;
  cursor: pointer;
}

#geoMap .leaflet-control-zoom a.leaflet-disabled {
  color: var(--color-text-light);
  border-color: var(--color-border);
  background-color: var(--color-background-dark);
  pointer-events: none;
  cursor: default;
}

#geoMap .leaflet-control-custom svg {
  fill: var(--color-primary);
}

/* GEOSA copyright / brand badge (bottom-right) */
#geoMap .geo-copyright {
  text-align: center;
  line-height: 1.2;
}

#geoMap .geo-copyright img {
  width: 1.5rem;
  display: block;
  margin: 0 auto;
}

#geoMap .geo-copyright span {
  display: block;
  font-size: 0.6rem;
  color: #333;
  margin-top: 2px;
  text-shadow: 0 0 10px #fff, 0 0 20px #fff;
}

/* Branch pin (Leaflet L.divIcon) — teardrop matching the Google PinElement. */
.geo-pin {
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  border: 2px solid var(--color-primary-dark);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.geo-pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* ── Info panel (teal card) ────────────────────────────────────── */
.info-panel {
  position: absolute;
  background: var(--color-primary);
  border-radius: 14px;
  padding: 22px 24px 20px;
  width: 360px;
  max-width: calc(100% - 32px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  color: #fff;
  display: none;
  /* Above Leaflet panes/controls (which reach ~z 800–1000) so the card sits
     over the GEOSA map too. */
  z-index: 1100;
  /* Sit beside the marker. JS places the panel's top edge; the transform
     offsets it to one side of the pin (flipped via .ip-flip when needed). */
  transform: translateX(-70%);
  transition: left 0.2s ease, top 0.2s ease;
}

.info-panel.ip-flip {
  transform: translateX(calc(-100% - 18px));
}

.info-panel.visible {
  display: block;
}

.info-panel-close {
  /* position: absolute; */
  /* top: 14px; */
  /* inset-inline-start: 16px; */
  min-width: initial;
  width: fit-content;
  padding: 0;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
}

.info-panel-close:hover {
  opacity: 1;
  background-color: transparent;
}

.info-panel h3 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  /* margin: 0 0 16px; */
  /* padding-inline-start: 28px; */
}

.ip-row {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

.ip-row .ip-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.ip-address {
  align-items: flex-start;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: 4px;
}

.ip-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 4px 0;
}

.ip-directions {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ip-directions .ip-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ip-directions:hover {
  opacity: 0.85;
  color: #FFF;
}

/* ── Loading overlay ───────────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* Above Leaflet controls so it fully covers the GEOSA map while it loads. */
  z-index: 1200;
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 500;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: locator-spin 0.8s linear infinite;
}

@keyframes locator-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .locator-topbar,
  .locator-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .branch-select-wrap {
    width: 100%;
  }
}
